home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software of the Month Club 1996 June
/
Software of the Month Club 1996 June.iso
/
mac
/
Education
/
Extended Calculator II
/
Calculator programs
/
Guessing game
next >
Wrap
Text File
|
1996-03-04
|
434b
|
22 lines
a:=random(1,100);
h:=100;
l:=0;
x:=get("Guess a number between 1 and 100!",int((h+l)/2));
n:=1;
while (x<>a);
if (x<a);
l:=x;
x:=get("Wrong, guess higher!",int((h+l)/2));
else;
h:=x;
x:=get("Wrong, guess lower!",int((h+l)/2));
end;
n:=n+1;
end;
if (n=1);
show("Great kid, that was one in a million.",n);
else;
show("You finally got it right. Total number of guesses:",n);
end;